package com.example.demo.servise.impl;

import com.example.demo.dao.bookdao;
import com.example.demo.domain.consignee;
import com.example.demo.servise.booksevise;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service

public class bookservicempl implements booksevise {
    @Autowired
    private bookdao bod;

    @Override
    public Boolean save(consignee con) {
        return bod.insert(con)>0;
    }

    @Override
    public Boolean update(consignee con) {
        return bod.updateById(con)>0;
    }

    @Override
    public Boolean delete(Integer id) {
        return bod.deleteById(id)>0;
    }

    @Override
    public consignee getById(Integer id) {
        return bod.selectById(id);
    }

    @Override
    public List<consignee> getAll() {
        return bod.selectList(null);
    }
}
